	PRO CON,dir,time,Nproc,Nleva,Nlevfp,Nlevfe,PS=PS
; Contour labels of scalar potentials a(x,y), f(x,y), b(x,y) and u(x,y) 
; You must use the subrutine LEER.PRO,time,N,Nproc,a,f,b,u,jj,ww
; 
leer_input,dir,N,nu,eta,eps,delta,dt,nstep,nstg,nstdat,nstk,nstp
leer,dir,time,Nproc,a,f,b,u,jj,ww,t
x=2.*!pi*dindgen(N)/N & y=x

if delta ne 0 then epse=eps*delta^0.5
if delta eq 0 then epse=10

fp=f+(eps*delta/(1+delta)^0.5)*b
fe=f-(eps/(1+delta)^0.5)*b

up = u + (eps*delta/(1+delta)^0.5)*jj
ue = u - (eps/(1+delta)^0.5)*jj

;Contour plot of a(x,y), b(x,y)
if not keyword_set(ps) then window,0,xs=2*N,ys=N,title='Contour Plots'

if keyword_set(ps) then begin
set_plot,'PS'
device,filename=dir+'mag_contour_'+time+'.eps',bits_per_pixel=8,/encapsulated,xs=15,ys=12
endif

!p.multi = [0,2,1]

alevp = 0 + (1+findgen(Nleva))*(max(a) - 0)/(1 + Nleva)
alevn = min(a) + (1+findgen(Nleva))*(0 - min(a))/(1 + Nleva)
contour,a,x,y,lev=alevp,xtitle='x',ytitle='y',xticks=1,yticks=1,xr=[0,2*!dpi],yr=[0,2*!dpi],xsty=1,ysty=1,title='a(x,y)'
contour,a,x,y,lev=alevn,c_linest=1,/overplot
contour,a,x,y,lev=0,/overplot

blevp= 0 + (1+findgen(Nleva))*(max(b) - 0)/(1 + Nleva)
blevn=min(b)+(1+findgen(Nleva))*(0 - min(b))/(1 + Nleva)
contour,b,x,y,lev=blevp,xtitle='x',ytitle='y',xticks=1,yticks=1,xr=[0,2*!dpi],yr=[0,2*!dpi],xsty=1,ysty=1,title='b(x,y)'
contour,b,x,y,lev=flevn,c_linest=1,/o
contour,b,x,y,lev=0,/overplot

if keyword_set(ps) then begin
device,/close
set_plot,'X'
endif

;Contour plot of fi(x,y), ui(x,y)

if not keyword_set(ps) then window,1,xs=2*N,ys=N,title='Contour Plots'

if keyword_set(ps) then begin
set_plot,'PS'
device,filename=dir+'kini_contour_'+time+'.eps',bits_per_pixel=8,/encapsulated,xs=15,ys=12
endif
	
!p.multi = [0,2,1]

flevpp = 0 + (1+findgen(Nlevfp))*(max(fp) - 0)/(1 + Nlevfp)
flevpn = min(fp) + (1+findgen(Nlevfp))*(0 - min(fp))/(1 + Nlevfp)
contour,fp,x,y,lev=flevpp,xtitle='x',ytitle='y',xticks=1,yticks=1,xr=[0,2*!dpi],yr=[0,2*!dpi],xsty=1,ysty=1,title='fi(x,y)'
contour,fp,x,y,lev=flevpn,c_linest=1,/overplot
contour,fp,x,y,lev=0,/overplot

ulevpp= 0 + (1+findgen(Nlevfp))*(max(up) - 0)/(1 + Nlevfp)
ulevpn= min(up) + (1+findgen(Nlevfp))*(0 - min(up))/(1 + Nlevfp)
contour,up,x,y,lev=ulevpp,xtitle='x',ytitle='y',xticks=1,yticks=1,xr=[0,2*!dpi],yr=[0,2*!dpi],xsty=1,ysty=1,title='ui(x,y)'
contour,up,x,y,lev=ulevpn,c_linest=1,/o
contour,up,x,y,lev=0,/overplot
if keyword_set(ps) then begin
device,/close
set_plot,'X'
endif

;Contour plot of fi(x,y), ui(x,y)

if not keyword_set(ps) then window,2,xs=2*N,ys=N,title='Contour Plots'

if keyword_set(ps) then begin
set_plot,'PS'
device,filename=dir+'kine_contour_'+time+'.eps',bits_per_pixel=8,/encapsulated,xs=15,ys=12
endif

!p.multi = [0,2,1]

flevep = 0 + (1+findgen(Nlevfe))*(max(fe) - 0)/(1 + Nlevfe)
fleven = min(f) + (1+findgen(Nlevfe))*(0 - min(fe))/(1 + Nlevfe)
contour,fe,x,y,lev=flevep,xtitle='x',ytitle='y',xticks=1,yticks=1,xr=[0,2*!dpi],yr=[0,2*!dpi],xsty=1,ysty=1,title='fe(x,y)'
contour,fe,x,y,lev=fleven,c_linest=1,/overplot
contour,fe,x,y,lev=0,/overplot

ulevep= 0 + (1+findgen(Nlevfe))*(max(ue) - 0)/(1 + Nlevfe)
uleven= min(ue) + (1+findgen(Nlevfe))*(0 - min(ue))/(1 + Nlevfe)
contour,ue,x,y,lev=ulevep,xtitle='x',ytitle='y',xticks=1,yticks=1,xr=[0,2*!dpi],yr=[0,2*!dpi],xsty=1,ysty=1,title='ue(x,y)'
contour,ue,x,y,lev=uleven,c_linest=1,/o
contour,ue,x,y,lev=0,/overplot
if keyword_set(ps) then begin
device,/close
set_plot,'X'
endif
end
